const { DataTypes } = require('sequelize');
const sequelize = require('../db/seq')


const User = sequelize.define('User', {
    // 在这里定义模型属性
    id: {
        type: DataTypes.INTEGER,
        primaryKey: true,
        autoIncrement: true,
        comment: '用户id'
    },
      userName: {
        type: DataTypes.STRING,
        allowNull: false,
        unique: true,
        comment: '用户名'
    },
    phone: {
        type: DataTypes.STRING,
        allowNull: false,
        comment: '用户手机号'
    },
    password: {
        type: DataTypes.CHAR,
        allowNull: false,
        comment: '用户密码'
    },
    role: {
        type: DataTypes.STRING,
        allowNull: false,
        comment: 'user用户,visitor游客,admin管理员'
    },
});
//  User.sync({ force: true })
module.exports = User
 